<?php 
	if(!isset($_SESSION['acms_user']))
	{
		include('./style/pages/403.php'); 
		break;
	}
?>	

 

		
		
<style>

table{margin-bottom:18px;padding:0;border-collapse:separate;*border-collapse:collapse;font-size:13px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}table th,table td{padding:10px 10px 9px;line-height:18px;text-align:left;}
table th{padding-top:9px;font-weight:bold;vertical-align:middle;border-bottom:1px solid #ddd; text-align: center; background: #E0EBFF;}
table .niceBody {background: #efe;}
table td{vertical-align:top;}
table th+th,table td+td{border-left:1px solid #ddd;}
table tr+tr td{border-top:1px solid #ddd;}
table tbody tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;}
table tbody tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;}
table tbody tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;}
table tbody tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;}
.zebra-striped tbody tr:nth-child(odd) td{background-color:#E0EBFF;}
.zebra-striped tbody tr:hover td{background-color:#a9dba9;}
.zebra-striped .header{cursor:pointer;}.zebra-striped .header:after{content:"";float:right;margin-top:7px;border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:hidden;}
.zebra-striped .headerSortUp,.zebra-striped .headerSortDown{background-color:rgba(141, 192, 219, 0.25);text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);}
.zebra-striped .header:hover:after{visibility:visible;}
.zebra-striped .headerSortDown:after,.zebra-striped .headerSortDown:hover:after{visibility:visible;filter:alpha(opacity=60);-khtml-opacity:0.6;-moz-opacity:0.6;opacity:0.6;}
.zebra-striped .headerSortUp:after{border-bottom:none;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;visibility:visible;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:alpha(opacity=60);-khtml-opacity:0.6;-moz-opacity:0.6;opacity:0.6;}

</style>

<div class="postheader"><h1>Messagerie</h1></div>
<div class="postcontent">
	<?php 
	if($_GET['action']==null)
	{
	?>
             <br />
    <table  class="zebra-striped">
        <thead>
            <tr>
                <td class="title_form_little" >Exp&eacute;diteur</td><td class="title_form_little" >R&eacute;ceptionneur</td><td class="title_form">Sujet</td>
            </tr>
        </thead>
        <tbody>  
		  <?php echo messageBox();?>
	</tbody>
    </table>
	<?php 
	}
	else if($_GET['action']=="new")
	{
	?>
    <br />
   
	
		               <form method="post" action="./index.php?page=message&action=send">
                <table>
                    <thead>
                        <tr>
                            <th colspan="2">Envoyer un message priv&eacute;</th>
                        </tr>
                    </thead>
                    <tbody class="niceBody">
                        <tr>
                            <td>Destinataire :</td>
                            <td>
                               <?php echo all_players();?>
                            </td>
                        </tr>
                        <tr>
                            <td>Sujet :</td>
                            <td><input type="text" name="sujet" /></td>
                        </tr>
                        <tr>
                            <td>Message :</td>
                            <td>
                                <textarea cols="30" rows="5" name="message" id="message">Votre message ici...</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center;">
                                <input type="submit" name="send" value="Envoyer" class="btn primary" title="Envoyer le message maintenant !" />
                                <a href="./index.php?page=message" class="btn">Retour</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </form>
			
			<?php
			}
			?>
			
			
			
			
    <br />
    <br />
	
	<a href="./index.php?page=message&action=new" class="button">Nouveau message</a> <a href="./index.php?page=message&action=deleteAll" class="button">Tout supprimer</a> <br />
			
			
</div>